
<?php
include "konek.php"; // untuk memanggil koneksi
$PeritahSql="select * from SDM";
$Query = oci_parse($koneksi,$PeritahSql); 
oci_execute($Query);
echo "<b>";
echo "<center>DAFTAR KARYAWAN</center>";
echo "</b>";
echo "<table width='80%' border='1' align='center'>";
echo "<td width='100%' colspan='6' align='right'><a href='frm_input.php'>TAMBAH DATA</a></td>";
echo "<tr align='center'><td>ID KARYAWAN</td><td>NAMA KARYAWAN</td><td>JABATAN</td><td>DIVISI</td><td colspan='2'>ACTION</td></tr>";
while (oci_fetch_array($Query)){
 	echo "<tr>
	<td width='10%'>".ociresult($Query,"NIK")."</td>
	<td width='30%'>".ociresult($Query,"NAMA_KARYAWAN")."</td>
	<td width='30%'>".ociresult($Query,"NAMA_JABATAN")."</td>
	<td width='10%'>".ociresult($Query,"NAMA_DIVISI")."</td>
	<td width='5%' align='center'><a href='frm_edit.php?nik=".ociresult($Query,"NIK")."'>.EDIT.</a></td>
	<td width='5%' align='center'><a href='proses_deldata.php?nik=".ociresult($Query,"NIK")."'>.HAPUS.</a></td>
	</tr>";
	
	
}
//Menghitung jumlah data
$PeritahSqlJumlah="select COUNT (NIK) as ID from SDM";
$QueryJumlah = oci_parse($koneksi,$PeritahSqlJumlah); 
oci_execute($QueryJumlah);
oci_fetch_array($QueryJumlah);
echo "<td width='100%' colspan='6'>Jumlah Data : ".ociresult($QueryJumlah,"ID")."</td>";
echo "</table>";
oci_close($koneksi); // untuk menutup koneksi
?>